package com.g.Object;
/**
 * getClass()方法*/
public class TestGetClass {
    public static void main(String[] args) {
        Animal a=new Dog();
        System.out.println(a.getClass());       //打印：class com.g.Object.Dog
    }
}
class Animal{

}
class Dog extends Animal{

}
